﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using Microsoft.Practices.Unity.Configuration;
using System.Xml;
using System.Xml.Serialization;
using tjb.Utility.Config;
using SysConfiguration = System.Configuration.Configuration;
namespace Tjb.Config
{
    
    public class configuration : SystemConfigBase<configuration>
    {
        public List<section> configSections;
        public unity unity;
        protected override configuration Current
        {
            get { return this; }
        }
        protected override configuration CustomizingInit()
        {
            configSections = new List<section>();
            configSections.Add(new section());
            unity = new unity();
            return this;
        }
    }
    public class section
    {
        [XmlAttribute]
        public string name = "unity";
        [XmlAttribute]
        public string type = "Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration";
    }
    public class unity
    {
        public List<typeAlias> typeAliases = new List<typeAlias>();
        public List<container> containers = new List<container>();


    }
    public class typeAlias
    {
        [XmlAttribute]
        public string alias = "singleton";
        [XmlAttribute]
        public string type = "Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity";
    }

    public class lifetime
    {
        [XmlAttribute]
        public string type = "singleton";
    }
    public class type
    {
        [XmlElement]
        public lifetime lifetime = new lifetime();
        [XmlAttribute]
        public string name;
        [XmlAttribute("type")]
        public string mtype;
        [XmlAttribute]
        public string mapTo;
    }
    public class container
    {
        [XmlAttribute("name")]
        public string name;
        public List<type> types = new List<type>();
    }
   

}
